import request from '../utils/request'

export function getArticleListApi (params) {
  return request({ url: 'articles', params })
}

export function dislikeByIdApi (target) {
  return request({
    url: 'article/dislikes',
    method: 'POST',
    data: {
      target
    }
  })
}
// export function dislikeByIdApi (target) {
//   return request.post('article/dislikes', { target })
// }

/**
 *
 * @param {*} tatget 举报文章的ID
 * @param {*} type 举报类型
 */
export function reportByIdApi (target, type) {
  return request.post('article/reports', {
    target,
    type
  })
}

export function suggest (q) {
  return request.get('suggestion', q)
}
